package me.hgj.jetpackmvvm.ledun.ui.fragment.project

import android.os.Bundle
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.Observer
import androidx.recyclerview.widget.GridLayoutManager
import androidx.recyclerview.widget.LinearLayoutManager
import com.google.android.flexbox.FlexDirection
import com.google.android.flexbox.FlexboxLayoutManager
import com.google.android.flexbox.JustifyContent
import com.kingja.loadsir.core.LoadService
import kotlinx.android.synthetic.main.fragment_project.mode_recyclerView
import kotlinx.android.synthetic.main.include_toolbar.toolbar
import kotlinx.android.synthetic.main.include_viewpager.*
import me.hgj.jetpackmvvm.ledun.app.appViewModel
import me.hgj.jetpackmvvm.ledun.app.base.BaseFragment
import me.hgj.jetpackmvvm.ledun.app.ext.*
import me.hgj.jetpackmvvm.ledun.app.weight.loadCallBack.ErrorCallback
import me.hgj.jetpackmvvm.ledun.databinding.FragmentViewpagerBinding
import me.hgj.jetpackmvvm.ledun.viewmodel.request.RequestProjectViewModel
import me.hgj.jetpackmvvm.ledun.viewmodel.state.ProjectViewModel
import me.hgj.jetpackmvvm.ext.parseState
import me.hgj.jetpackmvvm.ledun.R
import me.hgj.jetpackmvvm.ledun.data.model.bean.Mode
import me.hgj.jetpackmvvm.ledun.databinding.FragmentProjectBinding
import me.hgj.jetpackmvvm.ledun.ui.adapter.ModeAdapter

/**
 * 作者　: hegaojian
 * 时间　: 2019/12/28
 * 描述　:
 */
class ProjectFragment : BaseFragment<ProjectViewModel, FragmentProjectBinding>() {


    private var modeList:ArrayList<Mode> = arrayListOf()

    private val modeAdapter: ModeAdapter by lazy { ModeAdapter(arrayListOf()) }

    /** */

    override fun initView(savedInstanceState: Bundle?) {

        mDatabind.includeToolbar.toolbar.run {
            init("场景模式设置")
        }
        modeList.add(Mode("日出模式",R.mipmap.sunrise))
        modeList.add(Mode("日落模式",R.mipmap.sunset))
        modeList.add(Mode("闪电模式",R.mipmap.lightning))
        modeList.add(Mode("雷雨模式",R.mipmap.thunder))
        modeList.add(Mode("日照模式",R.mipmap.highsun))
        modeList.add(Mode("海洋模式",R.mipmap.ocean))
        modeList.add(Mode("珊瑚模式",R.mipmap.coral))
        modeList.add(Mode("水草模式",R.mipmap.watergrass))
        modeList.add(Mode("睡眠模式",R.mipmap.sleep))
        modeList.add(Mode("深海意境",R.mipmap.deep))
        modeList.add(Mode("多彩模式",R.mipmap.colorful))
//        //初始化热门Recyclerview
        modeAdapter.data=modeList

        mode_recyclerView.init(GridLayoutManager(context,3),modeAdapter,false)
    }

    /**
     * 懒加载
     */
    override fun lazyLoadData() {

    }

    override fun createObserver() {

    }
}